Intent to unship: UA styles for h1 in article, aside, nav, section

591 views
Skip to first unread message

Simon Pieters

unread,
Mar 25, 2025, 2:27:28 AMMar 25
to dev-pl...@mozilla.org

Hi,

As of March 31 I intend to start a rollout of 50% of Beta 138 to remove UA styles for h1 in article, aside, nav, section on desktop. We will monitor web compat reports to evaluate impact. If it goes well, the plan is to roll out to 5% of Release 138 and then increase to 50%, and if it goes well, increase to 100% and let the change ride the trains for all platforms.

Status in other browsers is that they are interested in following our lead (1, 2). Chromium has also deprecated this, which makes the issue surface for web developers in Chromium's console as well as impacting the score in Lighthouse.

Bug to remove: https://bugzilla.mozilla.org/show_bug.cgi?id=1885509

Spec issue: https://github.com/whatwg/html/issues/7867

Rollout for Beta: https://experimenter.services.mozilla.com/nimbus/remove-ua-styles-for-h1-headings/summary

Rollout for Release: https://experimenter.services.mozilla.com/nimbus/remove-ua-styles-for-h1-headings-release/summary

Pref: layout.css.h1-in-section-ua-styles.enabled (false means the UA styles are removed)

Compat analysis:

We have a warning in the devtools console since 136 when a page has a h1 in article, aside, nav, or section, and no author-origin font-size or margins specified. The pref has been false in Nightly since March 2024, with only one web compat issue reported (the site was fixed).

Rationale and context for this change:

  • h1 was specified to have automatic heading level based on the number of ancestor sections (or aside, article, nav).
  • The default rendering was specified to (roughly) match, such that <section><h1> would have the same font-size and margin as h2
  • The default rendering was implemented in browsers, but not the heading level in the accessibility tree.
  • Websites started to use sectioning elements, but didn't expect automatic heading levels. It was not possible for browsers to change that without breaking user expectations.
  • The automatic heading level (a.k.a. the outline algorithm) was dropped from the spec, but the default UA stylesheet remained. This is what we're trying to remove now.

Advice for web developers: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements#specifying_a_uniform_font_size_for_h1

cheers,

--

Simon Pieters

unread,
Apr 14, 2025, 8:08:18 PMApr 14
to dev-pl...@mozilla.org
This change has been rolled out to 50% of beta 138 for the past two weeks. No reported regressions so far due to this change.

I have published an article on the MDN Blog which received some comments on Hacker News. After taking the feedback into consideration, the rollout plan is adjusted slightly:
  • Increase the rollout on 138 beta to 100% (asap), so that web developers who test in beta have a chance to see the change before it reaches users on release.
  • Only roll out to 10% of users on release, instead of 50%. This should be sufficient to make a decision to ship.
cheers,

Simon Pieters

unread,
May 20, 2025, 1:44:32 PM (14 days ago) May 20
to dev-pl...@mozilla.org
This change has now rolled out to 138 release channel (5% the first 2 weeks, 10% the past week), with no reported regressions. I'm calling success on the rollout experiment. When 139 is released, I plan to increase the rollout on desktop to 100%. The pref flip will ride the trains for 140.
Reply all
Reply to author
Forward
0 new messages